<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <script src="/assets/jquery/jquery-3.1.1.min.js"></script>
    <script src="/assets/layui-2.9.18/layui.js"></script>
    <link rel="stylesheet" href="/assets/layui-2.9.18/css/layui.css">
    <link rel="stylesheet" href="/assets/layui-2.9.18/css/admin.css">
    <script src="/assets/september/common.js"></script>
    <script src="/assets/september/htmlBuilder.js"></script>
    <script src="/assets/september/search.js"></script>
    <link rel="stylesheet" href="/assets/pages/form.css">
</head>
<body>
<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
    <form id="form" class="layui-form">
        <input type="hidden" value="${pool.id!}" name="id"/>
        <div class="layui-form-item">
            <label class="layui-form-label">名称 <em class="required">*</em>
            </label>
            <div class="layui-input-inline">
                <input type="text" name="poolName" value="${pool.poolName!}" lay-verify="required" autocomplete="off"
                       class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">磁盘路径</label>
            <div class="layui-input-inline width-100">
                <select name="storeType" id="type">
                    <option value="1" <#if pool.storeType==1 >selected</#if> >本地磁盘</option>
                    <option value="2" <#if pool.storeType==2 >selected</#if> >OSS</option>
                    <option value="2" <#if pool.storeType==3 >selected</#if> >FTP</option>
                    <option value="2" <#if pool.storeType==4 >selected</#if> >海康存储</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">磁盘路径</label>
            <div class="layui-input-inline">
                <input name="diskPath" autocomplete="off" value="${pool.diskPath!}" class="layui-input">
            </div>
        </div>
    </form>
    <div class="layui-form-item">
        <input type="button" class="layui-btn layui-btn-normal" style="float: right" lay-submit=""
               lay-filter="submit_button" value="确认"/>
    </div>
</div>
<script>
    layui.use(function () {
        var form = layui.form;

        /* 自定义验证规则 */

        form.on("submit", function (data) {
            prepareFormData(data);
            sajax({
                type: "POST",
                url: "/pisces/fileStore/pool/doUpdatePool",
                data: data.field,
                dataType: 'json'
            }).done(function (data) {
                if (data.code == -1) {
                    layer.msg(data.desc);
                } else {
                    layer.msg('保存成功', {shade: [0.1, '#fff'], time: 1600});
                    closeWindowAndRefreshParentCurrentPage();
                }
            });
        });
    });
</script>
</body>
</html>
